package com.drojian.demo1.root_fragment;

import android.content.Intent;
import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.drojian.demo.R;
import com.drojian.demo1.test4.GridActivity;
import com.drojian.demo1.test4.ListViewActivity;
import com.drojian.demo1.test4.RecyclerViewActivity;
import com.drojian.demo1.test4.ViewPager2Activity;
import com.drojian.demo1.test4.ViewPagerActivity;

public class RootFragment4 extends Fragment {


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.ui1_fragment_root4, container, false);
        Button listView1 = view.findViewById(R.id.listView1);
        Button gridView1 = view.findViewById(R.id.gridView1);
        Button recyclerView1 = view.findViewById(R.id.recyclerView1);
        Button viewPager1 = view.findViewById(R.id.viewPager1);
        Button viewPager2 = view.findViewById(R.id.viewPager2);



        listView1.setOnClickListener(v -> startActivity(new Intent(getContext(), ListViewActivity.class)));
        gridView1.setOnClickListener(v -> startActivity(new Intent(getContext(), GridActivity.class)));
        recyclerView1.setOnClickListener(v -> startActivity(new Intent(getContext(), RecyclerViewActivity.class)));
        viewPager1.setOnClickListener(v -> startActivity(new Intent(getContext(), ViewPagerActivity.class)));
        viewPager2.setOnClickListener(v -> startActivity(new Intent(getContext(), ViewPager2Activity.class)));


        return view;
    }

    public static RootFragment4 newInstance() {
        return new RootFragment4();
    }
}